package fr.gdi.android.news.fragment.help;

import android.app.Fragment;
import android.os.Bundle;
import android.text.Html;
import android.text.method.LinkMovementMethod;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import fr.gdi.android.news.Constants;
import fr.gdi.android.news.R;

public class HelpFragment extends Fragment
{
     
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
    {
        View v = inflater.inflate(R.layout.help, null);
        
        ((TextView) v.findViewById(R.id.title)).setText(getActivity().getText(R.string.app_name) + ", v" + Constants.VERSION.toString());
        
        TextView textView = (TextView) v.findViewById(R.id.source);
        String html = getActivity().getText(R.string.help_source).toString();
        textView.setText(Html.fromHtml(html));
        textView.setMovementMethod(LinkMovementMethod.getInstance());
        
        return v;
    }
}